package day2;

import org.junit.Test;

public class ForDemo {

	@Test
	public void test1() {
//		****
//		****
//		****
		for (int i = 1; i <= 4; i++) {
			System.out.print("*");
		}
		System.out.println();
		for (int i = 1; i <= 4; i++) {
			System.out.println("*");
		}
		System.out.println("-----------------");
		for (int i = 1; i <= 3; i++) {// 外层循环控制行数
			for (int j = 1; j <= 4; j++) {// 内层循环控制每一行打印多少打印多少列
				System.out.print("*");
			}
			System.out.println();
		}
	}

//	*
//	**
//	***
//	****
//	*****
	@Test
	public void test33() {
		// i=1 j=1
		// i=2 j=2
		// i=3 j=3
		for (int i = 1; i <= 5; i++) {
			for (int j = 1; j <= i; j++) {
				System.out.print("*");
			}
			System.out.println();
		}
	}

	@Test
	public void test4() {
		for (int i = 1; i <= 9; i++) {
			for (int j = 1; j <= i; j++) {
				System.out.print(j + "*" + i + "=" + (i * j) + "\t");
			}
			System.out.println();
		}
	}

	@Test
	public void test444() {
		for (int i = 1; i <= 9; i++) {
			for (int j = 1; j <= i; j++) {
				System.out.print(j + "*" + i + "=" + (i * j) + "\t");
			}
			System.out.println();
		}
	}

}
